﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace 小区物业管理系统
{
    public partial class 修改密码 : System.Web.UI.Page
    { 小区物业管理系统DataContext db = new 小区物业管理系统DataContext();
       

        protected void Page_Load(object sender, EventArgs e)
        {
            UnobtrusiveValidationMode = UnobtrusiveValidationMode.None;
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
          
            var res = from r in db.用户信息
                      where r.用户姓名 == TextBox1.Text && r.密码== TextBox2.Text
                      select r;
            if (res != null)
            {
                foreach (用户信息 r in res)
                {
                    r.密码 = TextBox3.Text;

                    
                }
            }
           
            db.SubmitChanges();
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/登录.aspx");
        }
    }
}